<div class="layui-fluid layui-anim website-anim" id="website-indicator-add" lay-title="评审标准管理新增">
    <div class="layui-row website-container">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form" lay-filter="standard-table-form">
                        <div class="layui-form-item">
                          <div class="layui-row">
                            <div class="layui-col-md12">
                                <label class="layui-form-label website-form-item-require">级别:</label>
                                <div class="layui-input-block">
                                    <input type="hidden" name="indicatorId" data-th-value="${indicatorId}">
                                    <select name="indicatorType" lay-verify="required">
                                        <option value="">请选择</option>
                                        <option value="A级">A级</option>
                                        <option value="B级">B级</option>
                                        <option value="C级">C级</option>
                                        <option value="D级">D级</option>
                                        <option value="E级">E级</option>
                                        <option value="F级">F级</option>
                                        <option value="G级">G级</option>
                                    </select>
                                </div>
                            </div>
                          </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                               <div class="layui-col-md12">
                                <label class="layui-form-label website-form-item-require">最大分值:</label>
                                    <div class="layui-input-block">
                                        <input type="number" onkeyup="value=value.replace(/[^\d]/g,'')" name="maxScore" autocomplete="off" lay-verify="required" class="layui-input" >
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                              <div class="layui-col-md12">
                                <label class="layui-form-label website-form-item-require">最小分值:</label>
                                <div class="layui-input-block">
                                    <input type="number" onkeyup="value=value.replace(/[^\d]/g,'')" name="minScore" autocomplete="off" lay-verify="required" class="layui-input" >
                                </div>
                              </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                              <div class="layui-col-md12">
                                <label class="layui-form-label website-form-item-require">描述:</label>
                                <div class="layui-input-block">
                                    <textarea name="questionDescription" maxlength="200" rows="3"  lay-verify="required" class="layui-textarea"></textarea>
                                </div>
                              </div>
                           </div>
                        </div>
                        <div class="layui-form-item website-hide">
                            <button class="layui-btn" lay-submit="" lay-filter="indicatorDetail-add-form-submit" id="submit"></button>
                            <button type="reset" class="layui-btn" id="reset"></button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script data-th-inline="none" type="text/javascript">
    layui.use(['jquery', 'form', 'table', 'website'], function () {
        var $ = layui.jquery,
            website = layui.website,
            form = layui.form,
            table = layui.table,
             $view = $('#website-indicator-add'),
            $searchForm = $view.find('form'),
            validate = layui.validate;
        form.verify(validate);
        form.render();
        form.on('submit(indicatorDetail-add-form-submit)', function (data) {
            var isTure= false;
            var lev= null;
            var cacheDataAdd = table.cache["indicatorDeatilTableUpdate"];
            cacheDataAdd.forEach((item,index) =>{
                if(item.indicatorType==data.field.indicatorType){
                    isTure =true;
                    lev=item.indicatorType;
                }
           })
            if(isTure){
                website.alert.error('已存在'+lev+'信息，请修改');
                return false;
            }
            debugger;
            var max=  data.field.maxScore;
            var min=  data.field.minScore;
           if(parseInt(max)<parseInt(min)) {
               website.alert.error('最大分值必须大于最小分值！');
               return false;
           }
            website.post(ctx + 'indicatorDetail', data.field, function () {

                layer.closeAll();
                website.alert.success('新增成功');
                $('#website-indicator-update').find('#query').click();
            });
            return false;
        });
    })
</script>